/*
Minims .Net Playstation 3 UPNP ContentDirectory
Copyright (C) 2008  Guillaume Plourde

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

using System;
using System.Collections.Generic;
using System.Text;

namespace minims
{
    class RootDevice
    {
		/// <summary>
		/// Xml Description of the upnp root device.
		/// </summary>
		/// <returns>string</returns>
        static public string GetRootDeviceXml()
        {
            StringBuilder DeviceXml = new StringBuilder();
            DeviceXml.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            DeviceXml.Append("<root xmlns=\"urn:schemas-upnp-org:device-1-0\">");
            DeviceXml.Append("<specVersion>");
            DeviceXml.Append("<major>1</major>");
            DeviceXml.Append("<minor>0</minor>");
            DeviceXml.Append("</specVersion>");
            DeviceXml.Append("<device>");
            DeviceXml.Append("<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>");
            DeviceXml.Append("<dlna:X_DLNACAP xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">image-upload,audio-upload,av-upload,create-child-container</dlna:X_DLNACAP>");
            DeviceXml.Append("<dlna:X_DLNADOC xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">DMS-1.50</dlna:X_DLNADOC>");
            DeviceXml.Append("<friendlyName>" + ConfigManager.GetFriendlyName + "</friendlyName>");
            DeviceXml.Append("<manufacturer></manufacturer>");
            DeviceXml.Append("<manufacturerURL>" + ConfigManager.GetManufacturerURL + "</manufacturerURL>");
            DeviceXml.Append("<modelDescription></modelDescription>");
            DeviceXml.Append("<modelName></modelName>");
            DeviceXml.Append("<modelNumber>2008-02</modelNumber>");
			DeviceXml.Append("<modelURL>" + ConfigManager.GetManufacturerURL + "</modelURL>");
            DeviceXml.Append("<serialNumber>" + ConfigManager.GetSerialNumber + "</serialNumber>");
            DeviceXml.Append("<UDN>uuid:" + ConfigManager.GetUniqueDeviceName + "</UDN>");
            DeviceXml.Append("<serviceList>");
            DeviceXml.Append("<service>");
            DeviceXml.Append("<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>");
            DeviceXml.Append("<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>");
			DeviceXml.Append("<SCPDURL>ContentDirectory.xml</SCPDURL>");
            DeviceXml.Append("<controlURL>ContentDirectory/control</controlURL>");
            DeviceXml.Append("<eventSubURL>ContentDirectory/event</eventSubURL>");
            DeviceXml.Append("</service>");
            DeviceXml.Append("</serviceList>");
            DeviceXml.Append("</device>");
            DeviceXml.Append("</root>");
			return DeviceXml.ToString();
        }
    }
}